home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / progrmng / mlpmodul.sit / MacLogimoPlus Documentation / DEF2 Files / Loader.DEF / Loader.DEF
Encoding:
Modula Definition  |  1990-06-14  |  1.6 KB  |  44 lines  |  [TEXT/PMED]

  1. DEFINITION MODULE Loader;
  2. (* overlay loader for the Modula system *)
  3. (* P. Fink, ETH / fixed by Tim Myers November 1986 *)
  4.  
  5. FROM SYSTEM IMPORT ADDRESS;
  6. EXPORT QUALIFIED  Call, Load, Unload;
  7.  
  8. PROCEDURE Call(VAR OvName: ARRAY OF CHAR; VAR result : INTEGER);
  9. (* load and execute overlay OvName, as a subroutine *)
  10. (* OvName must be a file name, possibly prefixed with a volume name.
  11.    volume handling:
  12.    no volume -- overlay is on the default volume
  13.    volume    -- overlay is on the specified volume
  14.    '*:'      -- search overlay on all the drives, highest driv num first.
  15.  
  16.    Done if: loading, and possibly execution, are errorfree.
  17.    default extension for the load file search will be .LOD
  18.    result is zero, when everything was ok, otherwise an error number
  19.    (system-dependent) *)
  20.  
  21.  
  22. (* more sophisticated functions: (not yet implemented) *)
  23. (* definitely not required for the compiler ! *)
  24. (* INTENDED FOR:
  25.    management of several independent loaded modules.
  26.    useful in M3 for the O.S., on the SMAKY 8 for XS-1.
  27.    consistency is important. it is an error to load when the
  28.    base layer is not loaded, or to unload when overlays are
  29.    still loaded.
  30.    The identification of the base layer for an overlay is
  31.    done at link time.
  32.    specs written by me (PF) *)
  33.  
  34. PROCEDURE Load (VAR ovname : ARRAY OF CHAR;  VAR reference: ADDRESS;
  35.                 VAR error : INTEGER);
  36. (* load overlay  ovname  into memory, and execute its initialization part.
  37.    does not unload it. code and data remain in memory *)
  38.  
  39. PROCEDURE Unload (reference: ADDRESS; VAR error: INTEGER);
  40. (* unload the referenced overlay *)
  41.  
  42. END Loader.
  43.  
  44.